package com.czxy.dao;

import com.czxy.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version v 1.0
 * @Author kami
 * @Date 2019/4/28
 */
public interface UserMapper {

    @Select("select * from user")
    public List<User> findAll();

    @Select("select * from user where loginName=#{username}")
    public User findUserByUserName(String username);

    @Insert("INSERT INTO user (loginName,password,email) VALUES (#{loginName},#{password},#{email})")
    public void registerUser(User user);

    @Insert("insert into `user`  values(#{uid},#{loginName},#{password},#{username},#{sex},#{birthday},#{phone},#{email},#{signature},#{grouping},#{integral},#{jurisdiction},0)")
    public void insert(User user);
}
